local AceGUI = LibStub('AceAddon-3.0'):NewAddon("Layer", "AceConsole-3.0", "AceEvent-3.0")

-- local frame = AceGUI:Create("Frame") -- 创建框架
-- frame:SetTitle("Layer") -- 设置框架标题
-- frame:SetStatusText("位面插件") -- 设置框架状态栏文字
-- frame:SetCallback("OnClose", function(widget) AceGUI:Release(widget) end) --设置调用
-- frame:SetLayout("Flow") -- 设置布局


local options = {
    name = "WelcomeHome",
    handler = AceGUI,
    type = 'group',
    args = {
        msg = {
            type = "input",
            name = "Message",
            desc = "情输入一个参数",
            usage = "<Your message>",
            get = "GetMessage",
            set = "SetMessage",
        },
    },
}


function AceGUI:OnInitialize()
    -- Called when the addon is loaded
    -- 输入 /wel 或者 /wh 参数  /wh msg helloworld
    LibStub("AceConfig-3.0"):RegisterOptionsTable("Layer", options, {"wel", "wh"})
end


function AceGUI:GetMessage(info)
    return self.message
end

function AceGUI:SetMessage(info, newValue)
    self.message = newValue
end


function AceGUI:OnEnable()
    self:RegisterEvent("ZONE_CHANGED")
    self:Print("Hello World!")
end

function AceGUI:ZONE_CHANGED()
    self:Print("welcome msg is:",self.message)
    self:Print("================")
    self:Print(GetBindLocation())
    self:Print("================")
    self:Print(GetSubZoneText())
end